<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php
$currentPage = $this->pagination->currentPage+1;
$pageCount = $this->pagination->pageCount;
$topPageCss = "";$param = $_REQUEST;
$param["page"]=1;
$topPageUrl = Yii::app()->createUrl($this->getOwner()->route,$param);
if($currentPage==1){
    $topPageCss = "disabled";
    $topPageUrl = "#";
}
$beforePageCss = "";$param["page"]=$currentPage-1;
$beforePageUrl = Yii::app()->createUrl($this->getOwner()->route,$param);
if($currentPage==1){
    $beforePageCss = "disabled";
    $beforePageUrl = "#";
}
$nextPageCss = "";$param["page"]=$currentPage+1;
$nextPageUrl = Yii::app()->createUrl($this->getOwner()->route,$param);
if($currentPage==$pageCount){
    $nextPageCss = "disabled";
    $nextPageUrl = "#";
}
$lastPageCss = "";$param["page"]=$currentPage+1;
$lastPageUrl = Yii::app()->createUrl($this->getOwner()->route,$param);
if($currentPage==$pageCount){
    $lastPageCss = "disabled";
    $lastPageUrl = "#";
}
?>
<h3>设备信息</h3>
<table cellspacing="0" class="Miniyun-list-table widefat fixed users">
	<thead>
		<tr>
			<th style="" class="manage-column column-cb check-column" id="cb"
				scope="col"> </th>
				<?php foreach(array_values($this->model->attributeDeviceHeader()) as $index=>$columnName):?>
			<th style="" class="manage-column column-username sortable desc"
				id="username" scope="col"><a href="#"><span><?php echo($columnName);?></span><span
				class="sorting-indicator"></span></a></th>
				<?php endforeach;?>
		</tr>
	</thead>
	<tfoot>
		<tr>
			<th style="" class="manage-column column-cb check-column" scope="col"></th>
				<?php foreach(array_values($this->model->attributeDeviceHeader()) as $index=>$columnName):?>
			<th style="" class="manage-column column-username sortable desc"
				scope="col"><a href="#"><span><?php echo($columnName);?></span><span
				class="sorting-indicator"></span></a></th>
				<?php endforeach;?>
		</tr>
	</tfoot>
	<tbody class="list:user" id="the-list">
        <?php foreach($this->data as $index=>$item):?>
            <tr class="alternate" id="miniyun_<?php echo($item->id);?>">
			<th class="check-column" scope="row"></th>
            <td class="username column-username">
            <?php echo $item->id; ?><br>
			<div class="row-actions">
            <span class="edit"> <?php echo CHtml::link(
                 '删除',
                 array('adminUserPanel/deleteDevice','id'=>$item->id, 'action'=>$this->action),
                 array('confirm' => '您确定删除这台设备吗?')
            );
            ?> </span>
			 </div>

            </td>
            <td class="username column-username">
            <?php echo $item->user_device_name; ?><br>
            </td>
            <td class="username column-username">
            <?php echo $item->updated_at; ?><br>
            </td>
			</tr>
        <?php endforeach;?>
	</tbody>

</table>

<div class="tablenav bottom">
<div class='tablenav-pages'><span class="displaying-num"><?php echo($this->pagination->itemCount)?>
个项目</span> <span class='pagination-links'><a
	class='first-page <?php echo($topPageCss);?>' title='前往第一页'
	href='<?php echo($topPageUrl);?>'>&laquo;</a> <a
	class='prev-page <?php echo($beforePageCss);?>' title='前往上一页'
	href='<?php echo($beforePageUrl);?>'>&lsaquo;</a> <span
	class="paging-input">第 <input class='current-page' title='当前页面'
	type='text' name='paged' value='<?php echo($currentPage);?>' size='1' />
页，共 <span class='total-pages'><?php echo($this->pagination->pageCount);?></span>
页</span> <a class='next-page <?php echo($nextPageCss);?>' title='前往下一页'
	href='<?php echo($nextPageUrl);?>'>&rsaquo;</a> <a
	class='last-page <?php echo($lastPageCss);?>' title='前往最后一页'
	href='<?php echo($lastPageUrl);?>'>&raquo;</a></span></div>
<br class="clear">
</div>
